import request from '@/utils/request'

// 查询暂借登记列表
export function listLoan(query) {
  return request({
    url: '/recovery/loan/list',
    method: 'get',
    params: query
  })
}

// 查询暂借登记详细
export function getLoan(loanId) {
  return request({
    url: '/recovery/loan/' + loanId,
    method: 'get'
  })
}

// 新增暂借登记
export function addLoan(data) {
  return request({
    url: '/recovery/loan',
    method: 'post',
    data: data
  })
}

// 修改暂借登记
export function updateLoan(data) {
  return request({
    url: '/recovery/loan',
    method: 'put',
    data: data
  })
}

// 删除暂借登记
export function delLoan(loanId) {
  return request({
    url: '/recovery/loan/' + loanId,
    method: 'delete'
  })
}

// 导出暂借登记
export function exportLoan(query) {
  return request({
    url: '/recovery/loan/export',
    method: 'get',
    params: query
  })
}

//获取合格商品
export function getGoodsLoan(data) {
  return request({
    url: '/recovery/loan/get/goods',
    method: 'post',
    data: data
  })
}

//批量新增
export function addLoanList(data) {
  return request({
    url: '/recovery/loan/add/list',
    method: 'post',
    data: data
  })
}
